//
//  Cook_SecCollectionViewCell.m
//  Cook Street
//
//  Created by dllo on 15/8/8.
//  Copyright (c) 2015年 LANOU. All rights reserved.
//

#import "Cook_SecCollectionViewCell.h"

@implementation Cook_SecCollectionViewCell


//只能用于方法的返回值
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {        
        
        CGFloat width = self.contentView.frame.size.width;
        
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.contentView.frame.size.width, self.contentView.frame.size.height)];
        _imageView.layer.masksToBounds = YES;
        _imageView.layer.cornerRadius = width/7;
        [self.contentView addSubview:_imageView];
        
        _textLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.contentView.frame.size.height , self.contentView.frame.size.width, 30)];
        _textLabel.textAlignment = 1;
        [self.contentView addSubview:_textLabel];
    }
    return self;
}


-(void)get:(CookModel *)get
{
    self.textLabel.text = get.title;
    
    for (NSString *str in get.albums) {
        
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:str] placeholderImage:[UIImage imageNamed:@"default"]];
    }
    
}

@end
